<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script>
    const str = '曾鹏大帅逼'
    //编码
    console.log(encodeURI(str))
    //解码
    console.log(decodeURI('%E6%9B%BE%E9%B9%8F%E5%A4%A7%E5%B8%85%E9%80%BC'))
  </script>
</body>

</html>